<?php
require_once '../include/common.inc.php';
//require_once '../login/login_check.php';
if ($action == "0")
{
	$query="select * from userinfo where id= '$id'";
    $result=$db->get_one($query);
}
?>

<script type="text/javascript">
function Juge(theForm){
 if(theForm.username.value==""){
  alert("用户名称不能为空！");
  theForm.username.focus();
  return false;
 }
}
</script>

<style type="text/css">
<!--
.STYLE1 {
	font-size: 24px;
	font-weight: bold;
}
-->
</style>

<div align="center" class="STYLE1">用户信息</div>
<form id="userform" name="userform" method="post" action="save.php" onSubmit="return Juge(this)">
  <p>
    <label>用户名称：
      <input name="username" type="text" id="username" value="<?php echo "$result[name]";?>"/>
    </label>必填
  </p>
  <p align="left">
    <label>用户类型：
    <select name="type" id="type">
      <option value="0" <?php if ($result[type] == "0")?>selected="selected">试用</option>
      <option value="1" <?php if ($result[type] == "1")?>selected="selected">注册</option>
    </select>
    </label>
  </p>
  <p align="left">
    <label>联系电话：
    <input name="tel" type="text" id="tel"  value="<?php echo "$result[tel]";?>"/>
    </label></p>
  <p align="left">
    <label>
   电子邮件：
      <input name="email" type="text" id="email"  value="<?php echo "$result[email]";?>"/>
    </label>
  </p>
  <p align="left">
    <label>
    <input type="submit" name="Submit" value="提交" />
    </label>
    <label></label>
    <?php if ($action == "0"){?>
    	<input name="actiontype" type="hidden" id="actiontype" value="0" />
    <?php }else{?>
    	<input name="actiontype" type="hidden" id="actiontype" value="1" />
    <?php }?>
    <input name="id" type="hidden" id="id" value="<?php echo "$result[id]";?>"/>
    <input name="tablename" type="hidden" id="tablename" value="userinfo" />
  </p>
</form>